4glte3na 2.2.2
Loading...
Searching...
No Matches
4glte3na


4G LTE 3 NA Click

4G LTE 3 NA Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : Sep 2024.
  • Type : UART type

Software Support

Example Description

Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.4GLTE3NA

Example Key Functions

Application Init

Initializes the driver and logger.

void application_init ( void )
{
log_cfg_t log_cfg;
c4glte3na_cfg_t c4glte3na_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
c4glte3na_cfg_setup( &c4glte3na_cfg );
if ( UART_ERROR == c4glte3na_init( &c4glte3na, &c4glte3na_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
app_state = C4GLTE3NA_POWER_UP;
log_printf( &logger, ">>> APP STATE - POWER UP <<<\r\n\n" );
}
#define C4GLTE3NA_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition c4glte3na.h:140
void application_init(void)
Definition main.c:218
#define MIKROBUS_POSITION_4GLTE3NA
Definition main.c:65
@ C4GLTE3NA_POWER_UP
Definition main.c:98

Application Task

Application task is split in few stages:

  • C4GLTE3NA_POWER_UP:

    Powers up the device, performs a factory reset and reads system information.

  • C4GLTE3NA_CONFIG_CONNECTION:

    Sets configuration to device to be able to connect to the network.

  • C4GLTE3NA_CHECK_CONNECTION:

    Waits for the network registration indicated via CEREG command and then checks the signal quality report.

  • C4GLTE3NA_CONFIG_EXAMPLE:

    Configures device for the selected example.

  • C4GLTE3NA_EXAMPLE:

    Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. By default, the TCP/UDP example is selected.

void application_task ( void )
{
switch ( app_state )
{
{
if ( C4GLTE3NA_OK == c4glte3na_power_up( &c4glte3na ) )
{
log_printf( &logger, ">>> APP STATE - CONFIG CONNECTION <<<\r\n\n" );
}
break;
}
{
if ( C4GLTE3NA_OK == c4glte3na_config_connection( &c4glte3na ) )
{
log_printf( &logger, ">>> APP STATE - CHECK CONNECTION <<<\r\n\n" );
}
break;
}
{
if ( C4GLTE3NA_OK == c4glte3na_check_connection( &c4glte3na ) )
{
log_printf( &logger, ">>> APP STATE - CONFIG EXAMPLE <<<\r\n\n" );
}
break;
}
{
if ( C4GLTE3NA_OK == c4glte3na_config_example( &c4glte3na ) )
{
app_state = C4GLTE3NA_EXAMPLE;
log_printf( &logger, ">>> APP STATE - EXAMPLE <<<\r\n\n" );
}
break;
}
{
c4glte3na_example( &c4glte3na );
break;
}
default:
{
log_error( &logger, " APP STATE." );
break;
}
}
}
@ C4GLTE3NA_OK
Definition c4glte3na.h:209
void application_task(void)
Definition main.c:251
@ C4GLTE3NA_EXAMPLE
Definition main.c:102
@ C4GLTE3NA_CONFIG_EXAMPLE
Definition main.c:101
@ C4GLTE3NA_CHECK_CONNECTION
Definition main.c:100
@ C4GLTE3NA_CONFIG_CONNECTION
Definition main.c:99

Note

In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER.

Example:

  • SIM_APN "internet"
  • SIM_SMSC "+381610401"
  • PHONE_NUMBER "+381659999999"

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.